package com.gzr.generic.currency;

import java.util.ArrayList;

public class Currency {
    public static void main(String[] args) {

        ArrayList<XiaoMi> xiaoMis = new ArrayList<>();
        xiaoMis.add(new XiaoMi());
        xiaoMis.add(new XiaoMi());
        go(xiaoMis);

        ArrayList<LiXiang> liXiangs = new ArrayList<>();
        liXiangs.add(new LiXiang());
        liXiangs.add(new LiXiang());
        go(liXiangs);

        ArrayList<Dog> dogs = new ArrayList<>();
        dogs.add(new Dog());
        dogs.add(new Dog());
//        go(dogs);

    }

    /**
     * 通配符？ 可以在使用泛型的时候代表一切类型
     * 泛型上限 ? extends Car 能接收的必须的Car或者其子类
     * 泛型上限 ? extends Car 能接收的必须的Car或者其父类
     * @param list
     */
    public static void go(ArrayList<? extends Car> list) {

    }
}
